﻿using Microsoft.AspNetCore.Components;
using PlatformUW.Entities.Dtos;
using PlatformUW.Entities.RequestFeatures;
using PlatformUW.Web.HttpRepository;

namespace PlatformUW.Web.Pages
{
    public partial class Sensors
    {
        public List<SensorDto> SensorList { get; set; } = new();

        public PagedMetaData MetaData { get; set; } = new();

        public string code { get; set; } = "this is example";

        private readonly SensorParameter  sensorParameter = new ();

        [Inject]
        public ISensorHttpRepository SensorRepo { get; set; }

        protected override async Task OnInitializedAsync()
        {
            var pagingResponse = await SensorRepo.GetSensors(sensorParameter);
            SensorList = pagingResponse.Items;
            MetaData = pagingResponse.MetaData;
        }
    }
}


